<?php include('verify.php'); ?>
<html>
        <head><title>test</title></head>
<body onload="document.frmAwesome.Submit.focus()">
<div style="border:1px solid black;padding:20px;margin:20px;">
        <form action="<?php echo $PHP_SELF; ?>" method="post" name="frmAwesome">
                <div>Name:<input type="text" name="FullName" id="FullName" value="<?php echo $_REQUEST['FullName']; ?>"></div>
                <div><textarea name="Comment" style="height:100px;width:400px;"><?php echo $_REQUEST['Comment']; ?></textarea></div>
                <div><input name="Submit" id="Submit" type="submit" value="submit" /></div>
                <?php include('phpfp.php'); ?>
        </form>
</div>

<?php
if($_REQUEST) {
?>
	<div style="border:1px solid black;padding:20px;margin:20px;">
    Overall Results:
<?php if(testSubmission()===true) {
		echo 'Form submission was not spam.';
	} else {
		include('config.php');

		echo 'Form submission was spam.';
?>
	<br /><br />
	Individual test results:<br />
	<ol>
<?php
		echo '<li><strong>Mouse Movement test</strong>: ';
		if($phpfpConfig['mouseMovement']) {
			$res=testMouseMovement();
			if($res['Pass']) {
				echo '<em>pass</em>, movement was detected.';
			} else {
				echo '<em>fail</em>, movement was not detected.';
			}
		} else {
			echo 'not enabled.';
		}
		echo '</li>';

		echo '<li><strong>Keyboard Usage test</strong>: ';
		if($phpfpConfig['usedKeyboard']) {
			$res=testUsedKeyboard();
			if($res['Pass']) {
				echo '<em>pass</em>, keystrokes were detected.';
			} else {
				echo '<em>fail</em>, keystrokes were not detected.';
			}
		} else {
			echo 'not enabled.';
		}
		echo '</li>';

		echo '<li><strong>Timed Form test</strong>: ';
		if($phpfpConfig['timedFormSubmission']) {
			$res=testTimedFormSubmission();
			if($res['Pass']) {
				echo '<em>pass</em>, the form submission time was within the allowed time span.';
			} else {
				echo '<em>fail</em>, the form submission time was not within the allowed time span.';
			}
		} else {
			echo 'not enabled.';
		}
		echo '</li>';

		echo '<li><strong>Hidden Field test</strong>: ';
		if($phpfpConfig['hiddenFormField']) {
			$res=testHiddenFormField();
			if($res['Pass']) {
				echo '<em>pass</em>, the hidden field was empty as expected.';
			} else {
				echo '<em>fail</em>, the hidden field was not empty.';
			}
		} else {
			echo 'not enabled.';
		}
		echo '</li>';

		echo '<li><strong>Akismet test</strong>: ';
		if($phpfpConfig['akismet']) {
			$res=testAkismet();
			if($res['Pass']) {
				echo '<em>pass</em>, Akismet doesn\'t think this spam.';
			} else {
				echo '<em>fail</em>, Akismet thinks this is spam.';
			}
		} else {
			echo 'not enabled.';
		}
		echo '</li>';

		echo '<li><strong>Too Many Urls test</strong>: ';
		if($phpfpConfig['tooManyUrls']) {
			$res=testTooManyUrls();
			if($res['Pass']) {
				echo '<em>pass</em>, there were not too many URLs in the form contents.';
			} else {
				echo '<em>fail</em>, there were too many URLs in the form contents.';
			}
		} else {
			echo 'not enabled.';
		}
		echo '</li>';

		echo '<li><strong>Spam Strings test</strong>: ';
		if($phpfpConfig['teststrings']) {
			$res=testSpamStrings();
			if($res['Pass']) {
				echo '<em>pass</em>, the form contents did not contain too many spam strings from your list.';
			} else {
				echo '<em>fail</em>, the form contents contained too many spam strings from your list.';
			}
		} else {
			echo 'not enabled.';
		}
		echo '</li>';

		echo '<li><strong>Project Honeypot test</strong>: ';
		if($phpfpConfig['projectHoneyPot']) {
			$res=testProjHoneyPot();
			if($res['Pass']) {
				echo '<em>pass</em>, Project Honeypot did not identify this as spam.';
			} else {
				echo '<em>fail</em>, Project Honeypot identified this as spam.';
			}
		} else {
			echo 'not enabled.';
		}
		echo '</li>';
	}
}
?>
	</ol>
</div>

</body>
</html>